import React from 'react';
import { Table, message } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import { getRemoteData } from '@/services/ant-design-pro/getRemote';

import useRequest from '@ahooksjs/use-request';

const index = () => {
  const init = useRequest(getRemoteData);
  console.log(init);

  const columns = [
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
      render: (text: any) => <a>{text}</a>,
    },
    {
      title: '电话号码',
      dataIndex: 'phone',
      key: 'phone',
    },
    {
      title: '密码',
      dataIndex: 'password',
      key: 'password',
    },
  ];
  return (
    <PageContainer>
      <Table
        dataSource={init?.data?.data}
        columns={columns}
        pagination={false}
        rowKey="phone"
        loading={init?.loading}
      />
      ;
    </PageContainer>
  );
};

export default index;
